-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Workspace]Move set default data source before workspace update #7636
[Workspace]Move set default data source before workspace update #7636
Conversation
Signed-off-by: Lin Wang <wonglam@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7636 +/- ##
==========================================
+ Coverage 63.66% 63.68% +0.01%
==========================================
Files 3633 3633
Lines 80065 80107 +42
Branches 12685 12691 +6
==========================================
+ Hits 50973 51013 +40
- Misses 25986 25987 +1
- Partials 3106 3107 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
but we have try catch for whole update operation, not sure why it does not catch it and cause server crash |
The |
I see, thanks! |
@wanglam I guess the issue only happens when user self-removed from the workspace and assign/un-assign data source at the same time? |
@ruanyl I think it's not related to the assign/un-assign data source, the default data source will always be set to undefined if passed data sources is empty. In this case, I didn't change the data sources of workspace. |
Signed-off-by: Lin Wang <wonglam@amazon.com>
* Move set default data source before workspace update Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #7636 created/updated * Add comment for move set default data source before workspace update Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 761b2ff) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
… (#7664) * Move set default data source before workspace update * Changeset file for PR #7636 created/updated * Add comment for move set default data source before workspace update --------- (cherry picked from commit 761b2ff) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
This PR is for fixing dev server crash after un-assign self as a workspace owner. In previous implementation, the set default data source will be called after permission updated. The user won't have
write
permission to the workspace. So the set default data source operation will be failed and throw exception. Then there will be a unhandled promise rejection. Move set default data source before workspace update to avoid this issue.Issues Resolved
#7639
Screenshot
No UI Changes.
Testing the changes
yarn osd bootstrap
config/opensearch_dashboards.yml
yarn start --no-base-path
kibanauser
roleCollaborator
tabsave
button and then it will show success toasts and redirect workspace not found pageChangelog
Check List
yarn test:jest
yarn test:jest_integration